<?php
//include_once("../include/common.inc.php");
include_once('../comm.php');
if(isset($GLOBALS["HTTP_RAW_POST_DATA"])){
    $png = $GLOBALS['HTTP_RAW_POST_DATA'];
    
    
    if($FMUID!=0){
    	$path = '../tmp/'.$FMUID.time().'.png';
  	}else{
  		$path = '../tmp/515415'.time().'.png';
  	}
    
    //文件是否可写
    $fhandle = $path;
    if(!$handle = fopen($fhandle,'wb')){
        //print   "不能打开文件   $fhandle";
        echo 'FALSE';
        exit;
    }
    //   将$somecontent写入到打开的文件中。  
    if(!fwrite($handle,$png)){
        //print   "不能写入到文件   $fhandle";  
        echo 'FALSE';
        exit;
    }
    //print "成功地将   $somecontent   写入到文件$filename";  
    //echo 'TRUE';
    fclose($handle);
		$d = "<root><info><result>OK</result><file>".$path."</file></info></root>";	
		echo $d;
		exit;
}else {
    echo "FALSE";
}
?>